@layout("/backend/common/_container.html"){
<div class="dhcc-form">
        	<form method='post' id="importForm" name="importForm" action="${backendPath}/sds/contraindication/import" enctype="multipart/form-data">
				<div class="form-group">
				    <div class="ele">
				    	<input class="hisui-filebox" name="file" data-options="width:415,buttonText:'选择文件',prompt:'excel文件：*.xls,*.xlsx'" accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"/>
				    </div>
				</div>
         	</form>
         	<div class="alert alert-danger" role="alert">
         	<strong>注意：</strong>
         	<p>触发规则和表达式用()包起来</p>
			</div>

        <div class="toolbar">
            <#Button name="导入" id="ensure" icon="icon-w-import" clickFun="contraindication.import()"/>
            <#Button btnCss="l-bt-red" name="关闭" id="cancel" icon="icon-w-close" clickFun="contraindication.close()"/>
        </div>
</div>
<script>
var contraindication={};
contraindication.import = function () {
	Sys.loading("数据导入中...");
	var options = {
	    success: function(res) {
			Sys.closeLoading();
			if (res.code === 500) {
				Sys.error(res.message);
				return false;
			} else {
				Sys.success("导入成功！");
				contraindication.close();
			}

	    },
	    error: function(res) {
			Sys.closeLoading();
			Sys.error(res.responseJSON.error+":"+res.responseJSON.message);
	    }
	};

    $('#importForm').ajaxSubmit(options);
};
/**
 * 关闭此对话框
 */
contraindication.close = function () {
    parent.layer.close(parent.layer.getFrameIndex(window.name)); //先得到当前iframe层的索引,再执行关闭
};
</script>

@}
